{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 6.67 s\n"
     ]
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "%time from hikyuu.interactive.interactive import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 获取实时日线数据\n",
    "\n",
    "目前仅支持获取实时日线数据，使用函数 realtimeUpdate(source, delta=60)。其中，source支持 'sina' | 'qq' | 'tushare'，默认使用 tushare。\n",
    "\n",
    "tushare 需安装 Python tushare 库，pip install tushare.\n",
    "\n",
    "**使用 sina 或 qq 时，应注意控制两次获取数据之间的间隔时长（使用参数delta，默认时长60s），以免 ip 被 sina 或 qq 列入黑名单。**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 4.42 s\n"
     ]
    }
   ],
   "source": [
    "%time realtimeUpdate('tushare')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 2.46 s\n"
     ]
    }
   ],
   "source": [
    "%time realtimeUpdate('sina')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Wall time: 20.3 s\n"
     ]
    }
   ],
   "source": [
    "%time realtimeUpdate('qq')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python [conda root]",
   "language": "python",
   "name": "conda-root-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
